package com.awphone.data;

import com.awphone.data.constant.EObjectType;
import com.awphone.data.constant.NPAConst;

import javax.persistence.*;

/**
 * @author a_polyakov
 * Date: 03.03.13
 * Time: 22:35
 * Телефонный код штата
 * id  - идентификатор (трехзначный код)
 */
@Entity
@Table(schema = NPAConst.SCHEMA_NAME, name = NPAConst.TABLE_NAME)
public class NPA extends AbstractObject {
    /**
     * Штат
     */
    private State state;

    {
        setObjectType(EObjectType.NPA);
    }

    public NPA() {
    }

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = NPAConst.S_STATE, nullable = false, updatable = false)
    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }
}
